package com.xn.app.muying.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.xn.app.muying.R;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/12/20.
 */
public class FreedomAdapter extends BaseAdapter{
    private final LayoutInflater inflater;
    private Context context;
    private ArrayList<String> list = new ArrayList<>();

    public FreedomAdapter(Context context, ArrayList<String> list) {
        this.context = context;
        this.list = list;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder holder = null;
        if (view==null){
            view = inflater.inflate(R.layout.activity_vip_adapter,null);
            holder = new ViewHolder();
            holder.tv_title = (TextView) view.findViewById(R.id.activity_vip_adapter_tilte);
            holder.tv_content = (TextView) view.findViewById(R.id.activity_vip_adapter_content);
            view.setTag(holder);
        } else {
            holder = (ViewHolder) view.getTag();
        }
        switch (i){
            case 0:
                holder.tv_title.setText("健康档案在线查看");
                holder.tv_content.setText("医生就诊数据在线查看，在线管理，告别单纯依靠纸质报告单时代");
                break;
            case 1:
                holder.tv_title.setText("检查结果智能识别");
                holder.tv_content.setText("技术黑科技，帮你识别化验单，告诉你哪些项正常，哪些项异常");
                break;
            case 2:
                holder.tv_title.setText("远程胎心监护");
                holder.tv_content.setText("成为会员即可购买超声胎心仪，开启远程监护服务");
                break;
            case 3:
                holder.tv_title.setText("预约挂号");
                holder.tv_content.setText("手机移动挂号，方便快捷，还可以为家人挂号");
                break;
        }
        return view;
    }
    class ViewHolder {
        TextView tv_title,tv_content;
    }
}
